﻿#parse("partials/headerpopup.html")
<style>
    div#datalist_filter
    {
        display: none;
    }
    div#datalist_length
    {
        display: none;
    }
    .mws-table thead
    {
        margin-top: -10px;
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {
        var oTable = $('#datalist').dataTable({

            "bSort": false,
            "sPaginationType": "full_numbers",
            "bProcessing": false,
            "bServerSide": true,
            "sAjaxSource": "${rooturl}schedule/doctor/tablelistrooms/",
            "aoColumns": [

                             { "mDataProp": "idroom" },
                             { "mDataProp": "wardname" },
                             { "mDataProp": "roomname" },
                             { "mDataProp": "huroom" }

                        ]
                        ,
            "aoColumnDefs": [
                                {
                                    "fnRender": function (o) {
                                        return "<center><a class='dok' title='Select Doctor' href='javascript:void(0)' Id='" + o.aData['idroom'] + "' roomName='" + o.aData['roomname'] + "' ><img src='/images/Icons/table.png'/></a> </center>";
                                    },
                                    "aTargets": [0]
                                }
                        ],
            "fnServerData": function (sSource, aoData, fnCallback) {


                aoData.push({ "name": "start", "value": "$StartTime" });
                aoData.push({ "name": "end", "value": "$EndTime" });
                aoData.push({ "name": "day", "value": "$Day" });
                aoData.push({ "name": "roomname", "value": $("#roomnameid").val() });
                jQuery.ajax({
                    "dataType": 'json',
                    "type": "GET",
                    "url": "${rooturl}schedule/doctor/tablelistrooms/",
                    "data": aoData,
                    "success": fnCallback
                });
            }
        });

        function checkForEnter(event) {
            if (event.keyCode == 13) {
                oTable.fnDraw();
            }
        }
        $('#gname').keypress(checkForEnter);
        $('#buttonSearch').click(function () { oTable.fnDraw(); });
        $(".dok").live('click', function (event) {
            var roomid = $(this).attr("Id");
            var roomName = $(this).attr("roomname");
            parent.setPresentRoomTextBox(roomid, roomName);

        });
    });

</script>
<div class="mws-form" action="#">
    <div class="mws-form-inline">
        <div class="mws-form-row">
            <label>
                Room Name</label>
            <div class="mws-form-item small">
                <input type="text" class="mws-textinput mws-autocomplete" id="roomnameid" name="roomnameid" />
            </div>
        </div>
    </div>
    <div class="mws-button-row">
        <input id="buttonSearch" class="mws-button red" type="submit" value="Search" />
    </div>
    <div class="mws-form-row" style="padding-top: 10px">
        <table cellpadding="0" cellspacing="0" border="0" class="mws-table fullwidth" id="datalist"
            width="100%">
            <thead>
                <tr>
                    <th style="text-align: center; width: 10px">
                        Actions
                    </th>
                     <th style="text-align: center">
                        Ward Room
                    </th>
                    <th style="text-align: center">
                        Room
                    </th>
                    <th style="text-align: center">
                        Hospital
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td colspan="7" class="dataTables_empty">
                        <!--<img src="${rooturl}Images/Custom/252.gif" />-->
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
#parse("partials/footerpopup.html")